<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<base target="_self">
    
    <title>费用模板选择</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="费用,模板,选择">
	<meta http-equiv="description" content="This is my page">

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="toSelectChargeTemp.action" namespace="/inner/charge">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'费用模板选择'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden name="kindergartenId" id="kindergartenId"></s:hidden>
    		<s:hidden name="child.id" id="childId"></s:hidden>
    		
    		<table cellspacing="1" width="100%" bgcolor="#CCCCCC">
				<tr bgcolor="#FFFFFF">
					<td align="right" width="11%" class="label">
						模板名称：
					</td>
					<td align="left" width="22%">
						<s:textfield name="ctvo.ct.tempName" id="tempName" cssStyle="width:80%" cssClass="search"></s:textfield>
					</td>
					<td align="right" width="11%" class="label">
						描述：
					</td>
					<td align="left" width="22%">
						<s:textfield name="ctvo.ct.description" id="description" cssStyle="width:80%" cssClass="search"></s:textfield>
					</td>
					<td align="right" width="11%" class="label">
						所属班级:
					</td>
					<td align="left" width="23%">
						<s:select name="ctvo.classId" id="classId" value="%{ctvo.classId}" list="classList" listKey="id" listValue="className" headerKey="" headerValue="--请选择--" cssStyle="width:120px" cssClass="search"></s:select>
					</td>
				</tr>
			</table>
    		
    		<table cellspacing="0" width="100%">
				<tr>
					<td align="left">
						<input type="button" value="查询" class="btn" onclick="searchThis()"/>
						<input type="button" value="重置" class="btn" onclick="resetSearch()"/>
						<input type="button" value="手动输入" class="btn" onclick="manualInput()"/>
					</td>
				</tr>
			</table>
    	
    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr class="tableHead" align="center">
    				<td width="8%">
    					序号
    				</td>
    				<td width="20%">
    					模板名称
    				</td>
    				<td width="24%">
    					描述
    				</td>
    				<td width="20%">
    					所属班级
    				</td>
    				<td width="14%">
    					推荐
    				</td>
    				<td width="14%">
    					操作
    				</td>
    			</tr>
    			<s:iterator value="lp.list" status="s">
    				<tr align="center"
    					<s:if test="#s.index%2==0">class="tableRow2" onMouseMove="this.className='tableRow3'" onMouseOut="this.className='tableRow2'"</s:if>
						<s:else>class="tableRow1" onMouseMove="this.className='tableRow3'" onMouseOut="this.className='tableRow1'"</s:else>
    				>
    					<td>
    						<s:property value="(pager.thisPage - 1) * pager.pageSize + #s.index + 1" />
    					</td>
    					<td>
    						<s:property value="tempName"/>
    					</td>
    					<td>
    						<s:property value="description"/>
    					</td>
    					<td>
   							<s:property value="className"/>
    					</td>
    					<td>
   							<s:if test='classId.equals(cla.id)'>
   								<img src="${CONTEXT_PATH}/images/common/yes.gif" />
   							</s:if>
    					</td>
    					<td>
    						<a href="javascript:selectChargeTemp('<s:property value="id" />')">选择</a>
    					</td>
    				</tr>
    			</s:iterator>
    			<jsp:include page="/common/pager/pager.jsp">
					<jsp:param name="formName" value="frm" />
					<jsp:param name="id" value="1" />
				</jsp:include>
    		</table>
    	</s:form>
    </center>
    
    <script type="text/javascript">
    function selectChargeTemp(id)
    {
    	var obj = {'type':'temp', 'id':id};
    	setReturnValue(obj);
    	window.close();
    }
    
    function manualInput()
    {
    	var obj = {'type':'manual'};
    	setReturnValue(obj);
    	window.close();
    }
    
    function searchThis()
    {
    	$('#thisPage').val(1);
    	$('#frm').submit();
    }
    </script>
  </body>
</html>
